package ar.edu.unq.wannaplay.panels;

import org.apache.wicket.markup.html.link.Link;

import ar.edu.unq.wannaplay.pages.LoginPage;
import ar.edu.unq.wannaplay.roles.AbstractLinkAdderStrategy;

public class LogoutPanel extends NonServicedPanel {

    private static final long serialVersionUID = 1L;

    public LogoutPanel(final String id) {
        super(id);
        this.initialize();
    }

    private void initialize() {

        this.add(new Link("link") {
            private static final long serialVersionUID = 1L;

            @Override
            public void onClick() {
                AbstractLinkAdderStrategy.setLogedUser(null);
                this.setResponsePage(LoginPage.class);
            }
        });
    }
}
